package kr.hkit.androidcomplete01.ch07;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.View;

public class CustomView extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MyView mv = new MyView(this);
		setContentView(mv);
	}
	
	class MyView extends View{
		private Paint paint;
		
		public MyView(Context context){
			super(context);
			paint = new Paint(Paint.ANTI_ALIAS_FLAG);
		}
		
		@Override
		protected void onDraw(Canvas canvas) {
			super.onDraw(canvas);
			canvas.drawColor(Color.LTGRAY);
			
			paint.setColor(Color.BLUE);
			canvas.drawCircle(100, 100, 80, paint);
		}
	}
}
